# set the tagrt system
set(CMAKE_SYSTEM_NAME Linux)
set(CMAKE_SYSTEM_PROCESSOR aarch64)

set(PLATFORM_NAME peesp2) 

# set the toolchain path
set(TOOL_CHAIN_DIR /opt/powereuler/oecore-x86_64/sysroots/x86_64-openeulersdk-linux/usr)

# set the compiler
# 设置 C 和 C++ 编译器
set(CMAKE_C_COMPILER ${TOOL_CHAIN_DIR}/bin/aarch64-powereuler-linux-gcc)
set(CMAKE_CXX_COMPILER ${TOOL_CHAIN_DIR}/bin/aarch64-powereuler-linux-g++)

# 设置链接器
set(CMAKE_LINKER ${TOOL_CHAIN_DIR}/bin/aarch64-powereuler-linux-ld)
# 设置 Archiver
set(CMAKE_AR ${TOOL_CHAIN_DIR}/bin/aarch64-powereuler-linux-ar)

# 设置 RANLIB
set(CMAKE_RANLIB ${TOOLCHAIN_PREFIX}/bin/aarch64-powereuler-linux-ranlib)

# set the cmake find root path
set(CMAKE_FIND_ROOT_PATH ${TOOL_CHAIN_DIR}/aarch64-powereuler-linux)
# search for programs in the build host directories (not necessary)
set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
# 只在指定目录下查找库文件,只在指定目录下查找头文件,只在指定目录下查找依赖包
set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
set(CMAKE_FIND_ROOT_PATH_MODE_PACKAGE ONLY)
